package it.gtd.swimpool.controller.resources;

import it.gtd.swimpool.model.business.AccountManager;

import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.QueryParam;

@Stateless
@Path("/self/reset/")
public class AccountResource {
    @EJB
    private AccountManager accountManager;

    @PUT
    @Path("/password")
    public void resetPassword(
        @QueryParam("email") String email
    ) {
        accountManager.resetPassword(email);
    }

    @PUT
    @Path("/account")
    public void resetAccount(
        @QueryParam("name") String username
    ) {
        accountManager.resetAccount(username);
    }
}
